class ExceptionLoggingMiddleware(object):
    def process_exception(self, request, exception):
        print >> request.environ['wsgi.errors'], exception
        return None